//
//  ViewController.swift
//  TransitionView
//
//  Created by flipped on 2025/1/15.
//

import UIKit

class ViewController: UIViewController {
  @IBOutlet var img2: UIImageView!
  @IBOutlet var img1: UIImageView!

  private var retVisible: Bool = true
  override func viewDidLoad() {
    super.viewDidLoad()

    view.addSubview(img1)
		img1.center = view.center
  }

  override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
    super.touchesBegan(touches, with: event)

    UIView.transition(with: img1, duration: 1, options: []) {
      self.img1.alpha = 0.2
      self.img1.center = CGPoint(x: 200, y: 200)

    } completion: { _ in
      print("ani complete.")
    }

//    UIView.animate(withDuration: 1, delay: 0, options: []) {
//      self.img1.alpha = 0.5
//      self.img1.center = CGPoint(x: 200, y: 200)
//    }
  }
}
